// (C) Andreas Kaiser 2008

#ifndef _RFM02_H
#define _RFM02_H

#include "rf02.h"

void		rfm_init (uint16_t frequency, uint16_t clockout);
void		rfm_down (void);
void		rfm_cmd (uint16_t cmd);
uint8_t		rfm_error (void);		// return 1 on underrun

void		rfm_tx_start (void);		// start transmitter
int		rfm_tx_wait (uint8_t data);	// wait until ready, then transmit
int		rfm_tx (uint8_t data);		// return -1 when not ready, -2 on underrun
int		rfm_tx_finish (void);		// finish message (nonblocking)
int		rfm_tx_busy (void);		// return 0 when transmission complete
void		rfm_tx_stop (void);		// immediately stop transmitter

#define RFM_NOTREADY	-1
#define RFM_UNDERRUN	-2

#endif //_RFM02_H
